MODULE 'exec/nodes'

CONST	CD_RESET=1,
		CD_READ=2,
		CD_WRITE=3,
		CD_UPDATE=4,
		CD_CLEAR=5,
		CD_STOP=6,
		CD_START=7,
		CD_FLUSH=8,
		CD_MOTOR=9,
		CD_SEEK=10,
		CD_FORMAT=11,
		CD_REMOVE=12,
		CD_CHANGENUM=13,
		CD_CHANGESTATE=14,
		CD_PROTSTATUS=15,
		CD_GETDRIVETYPE=18,
		CD_GETNUMTRACKS=19,
		CD_ADDCHANGEINT=20,
		CD_REMCHANGEINT=21,
		CD_GETGEOMETRY=22,
		CD_EJECT=23,
		CD_INFO=32,
		CD_CONFIG=33,
		CD_TOCMSF=34,
		CD_TOCLSN=35,
		CD_READXL=36,
		CD_PLAYTRACK=37,
		CD_PLAYMSF=38,
		CD_PLAYLSN=39,
		CD_PAUSE=40,
		CD_SEARCH=41,
		CD_QCODEMSF=42,
		CD_QCODELSN=43,
		CD_ATTENUATE=44,
		CD_ADDFRAMEINT=45,
		CD_REMFRAMEINT=46,
		CDERR_OPENFAIL=-1,
		CDERR_ABORTED=-2,
		CDERR_NOCMD=-3,
		CDERR_BADLENGTH=-4,
		CDERR_BADADDRESS=-5,
		CDERR_UNITBUSY=-6,
		CDERR_SELFTEST=-7,
		CDERR_NotSpecified=20,
		CDERR_NoSecHdr=21,
		CDERR_BadSecPreamble=22,
		CDERR_BadSecID=23,
		CDERR_BadHdrSum=24,
		CDERR_BadSecSum=25,
		CDERR_TooFewSecs=26,
		CDERR_BadSecHdr=27,
		CDERR_WriteProt=28,
		CDERR_NoDisk=29,
		CDERR_SeekError=30,
		CDERR_NoMem=31,
		CDERR_BadUnitNum=32,
		CDERR_BadDriveType=33,
		CDERR_DriveInUse=34,
		CDERR_PostReset=35,
		CDERR_BadDataType=36,
		CDERR_InvalidState=37,
		CDERR_Phase=42,
		CDERR_NoBoard=50,
		TAGCD_PLAYSPEED=1,
		TAGCD_READSPEED=2,
		TAGCD_READXLSPEED=3,
		TAGCD_SECTORSIZE=4,
		TAGCD_XLECC=5,
		TAGCD_EJECTRESET=6

OBJECT CDInfo
	PlaySpeed:UWORD,
	ReadSpeed:UWORD,
	ReadXLSpeed:UWORD,
	SectorSize:UWORD,
	XLECC:UWORD,
	EjectReset:UWORD,
	Reserved1[4]:UWORD,
	MaxSpeed:UWORD,
	AudioPrecision:UWORD,
	Status:UWORD,
	Reserved2[4]:UWORD

CONST	CDSTSB_CLOSED=0,
		CDSTSB_DISK=1,
		CDSTSB_SPIN=2,
		CDSTSB_TOC=3,
		CDSTSB_CDROM=4,
		CDSTSB_PLAYING=5,
		CDSTSB_PAUSED=6,
		CDSTSB_SEARCH=7,
		CDSTSB_DIRECTION=8,
		CDSTSF_CLOSED=1,
		CDSTSF_DISK=2,
		CDSTSF_SPIN=4,
		CDSTSF_TOC=8,
		CDSTSF_CDROM=$10,
		CDSTSF_PLAYING=$20,
		CDSTSF_PAUSED=$40,
		CDSTSF_SEARCH=$80,
		CDSTSF_DIRECTION=$100,
		CDMODE_NORMAL=0,
		CDMODE_FFWD=1,
		CDMODE_FREV=2

OBJECT RMSF
	Reserved:UBYTE,
	Minute:UBYTE,
	Second:UBYTE,
	Frame:UBYTE

OBJECT LSNMSF
-> a) next is unioned with "lsn:LONG"
	MSF|LSN:RMSF

OBJECT CDXL
	Node:MLN,
	Buffer:PTR TO CHAR,
	Length:LONG,
	Actual:LONG,
	IntData:APTR,
	IntCode:LONG

OBJECT TocSummary
	FirstTrack:UBYTE,
	LastTrack:UBYTE,
	LeadOut:LSNMSF

OBJECT TocEntry
	CtlAdr:UBYTE,
	Track:UBYTE,
	Position:LSNMSF

OBJECT CDToc
-> a) next is unioned with "summary:tocsummary"
	Entry|Summary:TocEntry

OBJECT QCode
	CtlAdr:UBYTE,
	Track:UBYTE,
	Index:UBYTE,
	Zero:UBYTE,
	TrackPosition:LSNMSF,
	DiskPosition:LSNMSF

CONST	CTLADR_CTLMASK=$F0,
		CTL_CTLMASK=$D0,
		CTL_2AUD=0,
		CTL_2AUDEMPH=$10,
		CTL_4AUD=$80,
		CTL_4AUDEMPH=$90,
		CTL_DATA=$40,
		CTL_COPYMASK=$20,
		CTL_COPY=$20,
		CTLADR_ADRMASK=$F,
		ADR_POSITION=1,
		ADR_UPC=2,
		ADR_ISRC=3,
		ADR_HYBRID=5
